import request from '@/utils/request'

// 查询竞赛成果物列表
export function listCompetitionResult(query) {
  return request({
    url: '/race/competitionResult/list',
    method: 'get',
    params: query
  })
}

// 查询竞赛成果物详细
export function getCompetitionResult(id) {
  return request({
    url: '/race/competitionResult/' + id,
    method: 'get'
  })
}

// 新增竞赛成果物
export function addCompetitionResult(data) {
  return request({
    url: '/race/competitionResult',
    method: 'post',
    data: data
  })
}

// 修改竞赛成果物
export function updateCompetitionResult(data) {
  return request({
    url: '/race/competitionResult',
    method: 'put',
    data: data
  })
}

// 删除竞赛成果物
export function delCompetitionResult(id) {
  return request({
    url: '/race/competitionResult/' + id,
    method: 'delete'
  })
}

// 根据竞赛ID查询成果物列表
export function getCompetitionResultByCompetitionId(competitionId) {
  return request({
    url: '/race/competitionResult/competition/' + competitionId,
    method: 'get'
  })
}

// 根据报名记录ID查询成果物
export function getCompetitionResultBySignupId(signupId) {
  return request({
    url: '/race/competitionResult/signup/' + signupId,
    method: 'get'
  })
}

// 根据用户ID查询成果物列表
export function getCompetitionResultByUserId(userId) {
  return request({
    url: '/race/competitionResult/user/' + userId,
    method: 'get'
  })
}

// 统计成果物数量
export function getCompetitionResultCount() {
  return request({
    url: '/race/competitionResult/count',
    method: 'get'
  })
}

// 统计审核状态分布
export function getAuditStatusDistribution() {
  return request({
    url: '/race/competitionResult/auditStatus/distribution',
    method: 'get'
  })
}

// 统计竞赛成果物数量
export function getResultCountByCompetitionId(competitionId) {
  return request({
    url: '/race/competitionResult/competition/' + competitionId + '/count',
    method: 'get'
  })
}

// 审核成果物
export function auditCompetitionResult(data) {
  return request({
    url: '/race/competitionResult/audit',
    method: 'put',
    data: data
  })
}

// 提交成果物
export function submitCompetitionResult(data) {
  return request({
    url: '/race/competitionResult/submit',
    method: 'post',
    data: data
  })
}

